package com.xjtu.platform.user.admin.statistics.impl;

import com.xjtu.platform.user.admin.statistics.StatDto;
import com.xjtu.platform.user.admin.statistics.StatService;
import com.xjtu.platform.user.admin.statistics.dao.StatDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @创建人 MBY381
 * @创建时间 2022/7/6 19:56
 * @描述 暂无
 */

@Service
@Transactional
public class StatServiceImpl implements StatService {

    @Resource
    StatDao statDao;

    @Override
    public List<String> getItemList() {
        return statDao.findALLItems();
    }

    @Override
    public String getFileName(String visit_id) {
        return statDao.findFileName(visit_id);
    }

    @Override
    public StatDto getStat() {
        StatDto statDto = new StatDto();
        statDto.setActiveVisitNum(statDao.getActiveVisitNum());
        statDto.setTotalConsultNum(statDao.getTotalConsultNum());
        statDto.setTotalUserNum(statDao.getTotalUserNum());
        statDto.setTotalVisitNum(statDao.getTotalVisitNum());
        return statDto;
    }
}
